import Config from '@/settings'

const TokenKey = Config.TokenKey

export function getToken() {
  return localStorage.getItem(TokenKey)
}

export function setToken(token, rememberMe) {
  return localStorage.setItem(TokenKey, token)
  // 不需要记住密码功能， 浏览器可以自带
  // if (rememberMe) {
  //   return localStorage.setItem(TokenKey, token, {expires: Config.tokenCookieExpires})
  // } else {
  //   return localStorage.setItem(TokenKey, token)
  // }
}

export function removeToken() {
  return localStorage.removeItem(TokenKey)
}
